//=========================================================================
// Copyright (C) 2025 The C++ Component Model(COMO) Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//=========================================================================

#ifndef __ip_rtnetlink_multi__
#define __ip_rtnetlink_multi__

#ifdef __cplusplus
extern "C"
{
#endif

/**
 * 删除接口上的所有 IPv4 地址
 */
int rtnl_del_all_ipv4(int nl, int ifindex);

/**
 * 添加新地址
 */
int rtnl_add_ip(int nl, int ifindex, const char *ip_str, int prefixlen);

/**
 * 获取 ifindex+MAC
 */
int get_mac(const char *ifname, unsigned char *mac, int *ifindex_out);

/**
 * 发送 Gratuitous ARP
 */
int send_gratuitous_arp(int ifindex, const unsigned char *mac, const char *ip_str);

int iprtn_multi(char *argv);

#endif //__ip_rtnetlink_multi__
